//
//  CYMyFollow_WenZhangTableViewCell.m
//  cyydt
//
//  Created by chu on 2019/1/24.
//  Copyright © 2019 chu. All rights reserved.
//

#import "CYMyFollow_WenZhangTableViewCell.h"

@implementation CYMyFollow_WenZhangTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    self.headImageView.layer.cornerRadius = self.headImageView.frame.size.height / 2;
    self.headImageView.layer.masksToBounds = YES;
}

- (void)setModel:(CYProjectModel *)model{
    _model = model;
    [self.headImageView sd_setImageWithURL:[NSURL URLWithString:model.avatar] placeholderImage:[UIImage imageWithColor:[UIColor lightGrayColor] Size:self.headImageView.frame.size]];
    self.nicknameLabel.text = model.nickname;
    self.typeLabel.text = @"发布了文章";
    self.timeLabel.text = model.created_time;
    if ([model.tag isEqualToString:@"4"]) {
        //是项目号
        self.shenfenImageView.hidden = NO;
    }else{
        self.shenfenImageView.hidden = YES;
    }
    
    self.contentLabel.text = model.title;
    self.cateLabel.text = model.catname;
    self.pinglunLabel.text = [NSString stringWithFormat:@"%@评论", model.comment_number];
    self.bottomTimeLabel.text = model.created_time;
    if ([NSString stringIsNull:model.image]) {
        //没图片
        self.contentImageViewWidthConstrint.constant = 0;
        self.contentImageViewHeightConstraint.constant = 60;
    }else{
//        NSArray *img = [model.images componentsSeparatedByString:@","];
        self.contentImageViewWidthConstrint.constant = 110;
        self.contentImageViewHeightConstraint.constant = 80;
        [self.contentImageView sd_setImageWithURL:[NSURL URLWithString:model.image] placeholderImage:[UIImage imageWithColor:[UIColor lightGrayColor] Size:self.contentImageView.frame.size]];
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
